package com.juqent.kanban;

import android.content.Context;
import android.content.SharedPreferences;

public class SpUtils {
    private static final String PREF_NAME = "my_prefs";
    private static final String DEFAULT_VALUE = "";
    private SharedPreferences sharedPreferences;
    private SharedPreferences.Editor editor;

    public SpUtils(Context context) {
        sharedPreferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
    }

    public void setBaseUrl( String value) {
        editor.putString("baseUrl", value);
        editor.apply();
    }

    public String getBaseUrl() {
        return sharedPreferences.getString("baseUrl", DEFAULT_VALUE);
    }
}